package com.tanhua.server.controller;

import com.tanhua.commons.huanxin.utils.HuanXinUser;
import com.tanhua.commons.huanxin.utils.HuanXinUtils;
import com.tanhua.domain.db.User;
import com.tanhua.server.interceptor.UserThreadLocal;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class HuanXinController {

    @Autowired
    private HuanXinUtils huanXinUtils;

    @GetMapping("/huanxin/user")
    public ResponseEntity<HuanXinUser> queryUser(){
        User user = UserThreadLocal.get();
        HuanXinUser huanXinUser = new HuanXinUser();
        huanXinUser.setUsername(user.getId().toString());
        huanXinUser.setPassword("123456");
        return ResponseEntity.ok(huanXinUser);
    }
}
